package org.ourgrid.discoveryservice.communication.sender;

import java.io.IOException;

import org.ourgrid.common.internal.SenderIF;
import org.ourgrid.discoveryservice.config.DiscoveryServiceConfiguration;
import org.ourgrid.discoveryservice.response.PersistNetworkResponseTO;

import br.edu.ufcg.lsd.commune.container.servicemanager.ServiceManager;

public class PersistNetworkSender implements SenderIF<PersistNetworkResponseTO>{


	public void execute(PersistNetworkResponseTO response,
			ServiceManager manager) {
		
		try {
			DiscoveryServiceConfiguration.persistNetwork(response.getDiscoveryServicesAddresses(), 
					manager.getContainerContext());
		} catch (IOException e) {
			manager.getLog().error("Properties file could not be written with new Discovery Services Address", e);
		}
	}

	
}
